import { Pipe, PipeTransform } from '@angular/core';

import _ from 'lodash';

@Pipe({ name: 'getParentName' })
export class GetParentNamePipe implements PipeTransform {
    transform(id: number, source: object[]): string {
        return _.filter(source, (data) => {
            return data._id === id;
        })[0].name;
    }
}